package main

import (
	"fmt"
	"math/rand"
	"time"
)

func main() {
	numsChan := getRnd()

	for {
		fmt.Printf("%d\n", <-numsChan)
	}
}

func getRnd() <-chan int64 {
	outChan := make(chan int64)
	go func() {
		for {
			outChan <- rand.Int63()
			time.Sleep(1 * time.Second)
		}
	}()
	return outChan
}
